$.ajax({
	url:"/admin/querySelf",
	type:"post",
	success:function(res) {
		var head = $("#header-containner");
		var name = res.data;
		var content = "<nav class=\"navbar navbar-default navbar-fixed-top\">\r\n" + 
		"				<div class=\"container-fluid\">\r\n" + 
		"					<div class=\"navbar-header\">\r\n" + 
		"						<button type=\"button\" class=\"navbar-toggle collapsed\"\r\n" + 
		"							data-toggle=\"collapse\"\r\n" + 
		"							data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\r\n" + 
		"							<span class=\"sr-only\">切换导航</span> <span class=\"icon-bar\"></span>\r\n" + 
		"							<span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span>\r\n" + 
		"						</button>\r\n" + 
		"						<a class=\"navbar-brand\" href=\"/\">YlsatCMS</a>\r\n" + 
		"					</div>\r\n" + 
		"					<div class=\"collapse navbar-collapse\"\r\n" + 
		"						id=\"bs-example-navbar-collapse-1\">\r\n" + 
		"						<ul class=\"nav navbar-nav navbar-right\">\r\n" + 
		"							<li class=\"dropdown\"><a class=\"dropdown-toggle\"\r\n" + 
		"								data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\"\r\n" + 
		"								aria-expanded=\"false\">"+name+" <span class=\"caret\"></span></a></li>\r\n" + 
		"							<li><a href=\"login.html\"\r\n" + 
		"								onClick=\"if(!confirm('是否确认退出？'))return false;\">退出登录</a></li>\r\n" + 
		"						</ul>\r\n" + 
		"					</div>\r\n" + 
		"				</div>\r\n" + 
		"			</nav>";
		head.html(content);
	}
});

$.ajax({
	url:"/admin/queryrole",
	type:"post",
	success:function(data) {
		var side = $("#right-side");
		var content = "";
		if(data.data == 1) {
			content = "<ul class=\"nav nav-sidebar\">\r\n" + 
		"					<li class=\"active\"><a href=\"index.html\">汇总</a></li>\r\n" + 
		"				</ul>\r\n" + 
		"				<ul class=\"nav nav-sidebar\" id=\"su-admin\">\r\n" + 
		"					<li><a href=\"org-manage.html\">组织管理</a></li>\r\n" + 
		"					<li><a href=\"admin-manage.html\">管理员管理</a></li>\r\n" + 
		"				</ul>";
		} else {
			content = "<ul class=\"nav nav-sidebar\">\r\n" + 
		"					<li class=\"active\"><a href=\"index.html\">汇总</a></li>\r\n" + 
		"			   </ul>\r\n" + 
		"              <ul class=\"nav nav-sidebar\" id=\"nomal-admin\">\r\n" + 
		"					<li><a href=\"org-info.html\">组织信息</a></li>\r\n" + 
		"					<li><a class=\"dropdown-toggle\" id=\"otherMenu\"\r\n" + 
		"						data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">支部管理</a>\r\n" + 
		"						<ul class=\"dropdown-menu\" aria-labelledby=\"otherMenu\">\r\n" + 
		"							<li><a href=\"group-manage.html\">支部列表</a></li>\r\n" + 
		"							<li><a data-toggle=\"modal\" data-target=\"#areDeveloping\">支部用户</a></li>\r\n" + 
		"						</ul></li>\r\n" + 
		"				</ul>"
		}
		side.html(content);
	
	}
})




